<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>TechBlog - 教程列表</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        :root {
            /* 亮色主题变量 */
            --bg-color: #ffffff;
            --text-color: #24292f;
            --border-color: #d0d7de;
            --card-bg: #f6f8fa;
            --header-bg: #f6f8fa;
            --accent-color: #0969da;
            --accent-hover: #0550ae;
            --code-bg: rgba(175, 184, 193, 0.2);
            --shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
            --tag-bg: #ddf4ff;
            --tag-color: #0969da;
            --filter-bg: #f6f8fa;
            --input-bg: #ffffff;
            --beginner-color: #28a745;
            --intermediate-color: #ffc107;
            --advanced-color: #dc3545;
        }

        .dark-theme {
            /* 深色主题变量 */
            --bg-color: #0d1117;
            --text-color: #e6edf3;
            --border-color: #30363d;
            --card-bg: #161b22;
            --header-bg: #161b22;
            --accent-color: #2f81f7;
            --accent-hover: #1c6bdb;
            --code-bg: rgba(110, 118, 129, 0.4);
            --shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.7);
            --tag-bg: #388bfd26;
            --tag-color: #58a6ff;
            --filter-bg: #161b22;
            --input-bg: #0d1117;
            --beginner-color: #3fb950;
            --intermediate-color: #d29922;
            --advanced-color: #f85149;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            transition: background-color 0.3s, color 0.3s, border-color 0.3s;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
            background-color: var(--bg-color);
            color: var(--text-color);
            line-height: 1.5;
        }

        .container {
            max-width: 1280px;
            margin: 0 auto;
            padding: 0 20px;
        }

        /* 头部导航 */
        header {
            background-color: var(--header-bg);
            border-bottom: 1px solid var(--border-color);
            position: sticky;
            top: 0;
            z-index: 100;
        }

        .navbar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 16px 0;
            position: relative;
        }

        .logo {
            display: flex;
            align-items: center;
            gap: 10px;
            font-weight: 600;
            font-size: 20px;
            color: var(--text-color);
            text-decoration: none;
            z-index: 101;
        }

        .logo i {
            color: var(--accent-color);
        }

        .nav-links {
            display: flex;
            gap: 24px;
        }

        .nav-links a {
            color: var(--text-color);
            text-decoration: none;
            font-size: 14px;
            font-weight: 500;
            transition: all 0.2s ease;
        }

        .nav-links a:hover {
            color: var(--accent-color);
        }

        .nav-links a.active {
            color: var(--accent-color);
            font-weight: 600;
        }

        .nav-actions {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .theme-toggle {
            background: none;
            border: 1px solid var(--border-color);
            border-radius: 6px;
            padding: 8px 12px;
            color: var(--text-color);
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 14px;
            transition: all 0.2s ease;
        }

        .theme-toggle:hover {
            background-color: var(--code-bg);
        }

        .mobile-menu {
            display: none;
            background: none;
            border: 1px solid var(--border-color);
            border-radius: 6px;
            color: var(--text-color);
            cursor: pointer;
            padding: 8px 12px;
            font-size: 16px;
            transition: all 0.2s ease;
        }

        .mobile-menu:hover {
            background-color: var(--code-bg);
        }

        /* 主要内容区域 - 修改为flex布局 */
        .main-content {
            display: flex;
            flex-direction: column;
            gap: 24px;
            padding: 32px 0;
        }

        /* 文章标题区域 */
        .section-header {
            margin-bottom: 0;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 16px;
        }

        .section-header h2 {
            font-size: 24px;
            font-weight: 600;
            margin-bottom: 0;
        }

        /* 教程筛选和搜索区域 */
        .tutorials-controls {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 16px;
            padding: 16px;
            background-color: var(--filter-bg);
            border: 1px solid var(--border-color);
            border-radius: 6px;
            margin-bottom: 16px;
        }

        .search-box {
            position: relative;
            flex: 1;
            min-width: 250px;
        }

        .search-box input {
            width: 100%;
            padding: 8px 12px 8px 36px;
            border: 1px solid var(--border-color);
            border-radius: 6px;
            background-color: var(--input-bg);
            color: var(--text-color);
            font-size: 14px;
        }

        .search-box i {
            position: absolute;
            left: 12px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-color);
            opacity: 0.7;
        }

        .filter-controls {
            display: flex;
            gap: 12px;
            flex-wrap: wrap;
        }

        .filter-select {
            padding: 8px 12px;
            border: 1px solid var(--border-color);
            border-radius: 6px;
            background-color: var(--input-bg);
            color: var(--text-color);
            font-size: 14px;
            cursor: pointer;
        }

        /* 内容容器 - 侧边栏和教程列表的父容器 */
        .content-container {
            display: flex;
            gap: 32px;
            align-items: flex-start;
            /* 确保顶部对齐 */
        }

        /* 教程列表区域 */
        .tutorials-section {
            flex: 1;
            min-width: 0;
            /* 防止flex项目溢出 */
        }

        /* 教程卡片 */
        .tutorial-card {
            background-color: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 6px;
            padding: 24px;
            margin-bottom: 16px;
            box-shadow: var(--shadow);
            transition: border-color 0.2s ease, transform 0.2s ease;
        }

        .tutorial-card:hover {
            border-color: var(--accent-color);
            transform: translateY(-2px);
        }

        .tutorial-title {
            font-size: 20px;
            font-weight: 600;
            margin-bottom: 8px;
        }

        .tutorial-title a {
            color: var(--accent-color);
            text-decoration: none;
        }

        .tutorial-title a:hover {
            text-decoration: underline;
        }

        .tutorial-meta {
            display: flex;
            gap: 16px;
            margin-bottom: 12px;
            font-size: 14px;
            color: var(--text-color);
            opacity: 0.8;
            flex-wrap: wrap;
        }

        .tutorial-tags {
            display: flex;
            gap: 8px;
            margin-bottom: 12px;
            flex-wrap: wrap;
        }

        .tag {
            background-color: var(--tag-bg);
            color: var(--tag-color);
            padding: 2px 8px;
            border-radius: 12px;
            font-size: 12px;
            font-weight: 500;
        }

        .difficulty {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 2px 8px;
            border-radius: 12px;
            font-size: 12px;
            font-weight: 500;
        }

        .difficulty.beginner {
            background-color: rgba(40, 167, 69, 0.1);
            color: var(--beginner-color);
        }

        .difficulty.intermediate {
            background-color: rgba(255, 193, 7, 0.1);
            color: var(--intermediate-color);
        }

        .difficulty.advanced {
            background-color: rgba(220, 53, 69, 0.1);
            color: var(--advanced-color);
        }

        .tutorial-excerpt {
            margin-bottom: 16px;
            font-size: 14px;
            line-height: 1.6;
        }

        .read-more {
            color: var(--accent-color);
            text-decoration: none;
            font-size: 14px;
            font-weight: 500;
            transition: all 0.2s ease;
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }

        .read-more:hover {
            text-decoration: underline;
            gap: 8px;
        }

        /* 侧边栏 */
        .sidebar {
            width: 300px;
            flex-shrink: 0;
            /* 防止侧边栏缩小 */
            display: flex;
            flex-direction: column;
            gap: 24px;
        }

        /* 侧边栏区块 */
        .sidebar-section {
            background-color: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 6px;
            padding: 16px;
        }

        .sidebar-section h3 {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 12px;
            padding-bottom: 8px;
            border-bottom: 1px solid var(--border-color);
        }

        .about-me {
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
        }

        .avatar {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            margin-bottom: 12px;
            border: 2px solid var(--border-color);
        }

        .social-links {
            display: flex;
            gap: 12px;
            margin-top: 12px;
        }

        .social-links a {
            color: var(--text-color);
            font-size: 18px;
            transition: color 0.2s ease;
        }

        .social-links a:hover {
            color: var(--accent-color);
        }

        .categories-list,
        .tags-list {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        .categories-list a,
        .tags-list a {
            background-color: var(--code-bg);
            color: var(--text-color);
            padding: 4px 8px;
            border-radius: 6px;
            text-decoration: none;
            font-size: 12px;
            transition: all 0.2s ease;
        }

        .categories-list a:hover,
        .tags-list a:hover {
            background-color: var(--accent-color);
            color: white;
        }

        /* 代码块样式 */
        pre {
            background-color: var(--code-bg);
            border-radius: 6px;
            padding: 16px;
            overflow-x: auto;
            margin: 16px 0;
            font-size: 14px;
            border: 1px solid var(--border-color);
        }

        code {
            font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
        }

        /* 分页样式 */
        .pagination {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 8px;
            margin-top: 32px;
        }

        .pagination a,
        .pagination span {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 32px;
            height: 32px;
            padding: 0 8px;
            border: 1px solid var(--border-color);
            border-radius: 6px;
            text-decoration: none;
            color: var(--text-color);
            font-size: 14px;
            transition: all 0.2s ease;
        }

        .pagination a:hover {
            background-color: var(--code-bg);
            border-color: var(--accent-color);
        }

        .pagination .current {
            background-color: var(--accent-color);
            color: white;
            border-color: var(--accent-color);
        }

        .pagination .disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        /* 页脚 */
        footer {
            border-top: 1px solid var(--border-color);
            padding: 32px 0;
            text-align: center;
            font-size: 14px;
            color: var(--text-color);
            opacity: 0.8;
        }

        /* 响应式设计优化 */
        /* 中等屏幕 (平板横屏) */
        @media (max-width: 1024px) {
            .content-container {
                gap: 24px;
            }

            .sidebar {
                width: 250px;
            }

            .tutorial-card {
                padding: 20px;
            }
        }

        /* 小屏幕 (平板竖屏) */
        @media (max-width: 900px) {
            .content-container {
                flex-direction: column;
            }

            .sidebar {
                width: 100%;
                order: -1;
                margin-bottom: 0;
            }

            .sidebar-section {
                padding: 20px;
            }
        }

        /* 移动端优化 */
        @media (max-width: 768px) {
            .container {
                padding: 0 16px;
            }

            .navbar {
                padding: 12px 0;
            }

            .logo {
                font-size: 18px;
            }

            .nav-links {
                position: absolute;
                top: 100%;
                left: 0;
                width: 100%;
                background-color: var(--header-bg);
                border-top: 1px solid var(--border-color);
                flex-direction: column;
                padding: 16px 20px;
                display: none;
                box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            }

            .nav-links.active {
                display: flex;
            }

            .nav-links a {
                padding: 12px 0;
                border-bottom: 1px solid var(--border-color);
                font-size: 16px;
            }

            .nav-links a:last-child {
                border-bottom: none;
            }

            .mobile-menu {
                display: block;
                min-height: 44px;
                min-width: 44px;
                display: flex;
                align-items: center;
                justify-content: center;
            }

            .theme-toggle,
            .mobile-menu {
                padding: 10px 14px;
            }

            .main-content {
                padding: 24px 0;
                gap: 20px;
            }

            .content-container {
                gap: 20px;
            }

            .section-header {
                flex-direction: column;
                align-items: flex-start;
            }

            .section-header h2 {
                font-size: 20px;
            }

            .tutorials-controls {
                flex-direction: column;
                align-items: stretch;
            }

            .search-box {
                min-width: 100%;
            }

            .filter-controls {
                width: 100%;
                justify-content: space-between;
            }

            .tutorial-card {
                padding: 16px;
                margin-bottom: 12px;
            }

            .tutorial-title {
                font-size: 18px;
            }

            .tutorial-meta {
                flex-wrap: wrap;
                gap: 8px;
                font-size: 13px;
            }

            pre {
                padding: 12px;
                font-size: 13px;
            }

            .sidebar-section {
                padding: 16px;
            }

            .avatar {
                width: 60px;
                height: 60px;
            }

            .read-more,
            .categories-list a,
            .tags-list a {
                padding: 8px 12px;
                font-size: 14px;
            }

            /* 减少移动端的动画效果 */
            * {
                transition: none;
            }

            /* 保留必要的过渡 */
            .theme-toggle,
            .mobile-menu,
            .nav-links a,
            .read-more {
                transition: all 0.2s ease;
            }
        }

        /* 小屏手机优化 */
        @media (max-width: 480px) {
            .tutorial-meta {
                flex-direction: column;
                gap: 4px;
            }

            .tutorial-tags {
                gap: 6px;
            }

            .categories-list,
            .tags-list {
                gap: 6px;
            }

            .container {
                padding: 0 12px;
            }

            .content-container {
                gap: 16px;
            }

            .pagination {
                flex-wrap: wrap;
            }
        }

        /* 横屏模式优化 */
        @media (max-height: 500px) and (orientation: landscape) {
            .navbar {
                padding: 8px 0;
            }

            .main-content {
                padding: 16px 0;
            }

            .tutorial-card {
                padding: 12px;
                margin-bottom: 8px;
            }
        }
    </style>
</head>

<body class="light-theme">
    <header>
        <div class="container">
            <nav class="navbar">
                <a href="index.html" class="logo">
                    <i class="fas fa-code"></i>
                    TechBlog
                </a>

                <div class="nav-links">
                    <a href="index.html">首页</a>
                    <a href="article-list.html">文章</a>
                    <a href="tutorial-list.html" class="active">教程</a>
                    <a href="projects.html">项目</a>
                    <a href="about.html">关于</a>
                </div>

                <div class="nav-actions">
                    <button class="theme-toggle" id="themeToggle">
                        <i class="fas fa-moon"></i>
                        <span>深色模式</span>
                    </button>
                    <button class="mobile-menu" id="mobileMenu">
                        <i class="fas fa-bars"></i>
                    </button>
                </div>
            </nav>
        </div>
    </header>

    <div class="container">
        <div class="main-content">
            <!-- 标题放在flex容器外面 -->
            <div class="section-header">
                <h2>技术教程</h2>
                <div class="tutorials-info">
                    <span>共 <strong id="tutorialCount">12</strong> 个教程</span>
                </div>
            </div>

            <!-- 教程筛选和搜索区域 -->
            <div class="tutorials-controls">
                <div class="search-box">
                    <i class="fas fa-search"></i>
                    <input type="text" id="searchInput" placeholder="搜索教程...">
                </div>
                <div class="filter-controls">
                    <select class="filter-select" id="categoryFilter">
                        <option value="">所有分类</option>
                        <option value="JavaScript">JavaScript</option>
                        <option value="React">React</option>
                        <option value="Vue">Vue</option>
                        <option value="Node.js">Node.js</option>
                        <option value="CSS">CSS</option>
                        <option value="Git">Git</option>
                        <option value="数据库">数据库</option>
                        <option value="部署">部署</option>
                    </select>
                    <select class="filter-select" id="difficultyFilter">
                        <option value="">所有难度</option>
                        <option value="beginner">入门</option>
                        <option value="intermediate">中级</option>
                        <option value="advanced">高级</option>
                    </select>
                    <select class="filter-select" id="typeFilter">
                        <option value="">所有类型</option>
                        <option value="step-by-step">分步教程</option>
                        <option value="video">视频教程</option>
                        <option value="interactive">交互式教程</option>
                    </select>
                    <select class="filter-select" id="sortSelect">
                        <option value="newest">最新发布</option>
                        <option value="oldest">最早发布</option>
                        <option value="popular">最多浏览</option>
                        <option value="duration">教程时长</option>
                    </select>
                </div>
            </div>

            <!-- 侧边栏和教程列表放在同一个flex容器中 -->
            <div class="content-container">
                <main class="tutorials-section">
                    <article class="tutorial-card" data-category="React" data-difficulty="beginner"
                        data-type="step-by-step" data-date="2023-10-20" data-views="850" data-duration="45">
                        <h3 class="tutorial-title">
                            <a href="tutorial-detail.html">React入门教程：从零开始构建你的第一个应用</a>
                        </h3>
                        <div class="tutorial-meta">
                            <span><i class="far fa-calendar"></i> 2023-10-20</span>
                            <span><i class="far fa-clock"></i> 45分钟</span>
                            <span><i class="far fa-eye"></i> 850浏览</span>
                            <span class="difficulty beginner"><i class="fas fa-signal"></i> 入门</span>
                            <span><i class="fas fa-book"></i> 分步教程</span>
                        </div>
                        <div class="tutorial-tags">
                            <span class="tag">React</span>
                            <span class="tag">JavaScript</span>
                            <span class="tag">前端</span>
                            <span class="tag">入门</span>
                        </div>
                        <p class="tutorial-excerpt">
                            本教程适合React初学者，通过实际项目带你了解React的基本概念，包括组件、状态和属性。我们将一步步构建一个简单的待办事项应用。
                        </p>
                        <a href="tutorial-detail.html" class="read-more">开始学习 <i class="fas fa-arrow-right"></i></a>
                    </article>

                    <article class="tutorial-card" data-category="Git" data-difficulty="intermediate" data-type="video"
                        data-date="2023-10-15" data-views="1200" data-duration="30">
                        <h3 class="tutorial-title">
                            <a href="tutorial-detail.html">Git高级技巧：分支策略与团队协作</a>
                        </h3>
                        <div class="tutorial-meta">
                            <span><i class="far fa-calendar"></i> 2023-10-15</span>
                            <span><i class="far fa-clock"></i> 30分钟</span>
                            <span><i class="far fa-eye"></i> 1.2k浏览</span>
                            <span class="difficulty intermediate"><i class="fas fa-signal"></i> 中级</span>
                            <span><i class="fas fa-video"></i> 视频教程</span>
                        </div>
                        <div class="tutorial-tags">
                            <span class="tag">Git</span>
                            <span class="tag">版本控制</span>
                            <span class="tag">团队协作</span>
                            <span class="tag">最佳实践</span>
                        </div>
                        <p class="tutorial-excerpt">
                            学习Git分支管理的最佳实践，包括Git Flow工作流、解决合并冲突的技巧，以及如何与团队高效协作。适合已经掌握Git基础知识的开发者。
                        </p>
                        <a href="tutorial-detail.html" class="read-more">开始学习 <i class="fas fa-arrow-right"></i></a>
                    </article>

                    <article class="tutorial-card" data-category="Node.js" data-difficulty="advanced"
                        data-type="interactive" data-date="2023-10-10" data-views="950" data-duration="90">
                        <h3 class="tutorial-title">
                            <a href="tutorial-detail.html">Node.js性能优化与调试高级技巧</a>
                        </h3>
                        <div class="tutorial-meta">
                            <span><i class="far fa-calendar"></i> 2023-10-10</span>
                            <span><i class="far fa-clock"></i> 90分钟</span>
                            <span><i class="far fa-eye"></i> 950浏览</span>
                            <span class="difficulty advanced"><i class="fas fa-signal"></i> 高级</span>
                            <span><i class="fas fa-laptop-code"></i> 交互式教程</span>
                        </div>
                        <div class="tutorial-tags">
                            <span class="tag">Node.js</span>
                            <span class="tag">性能优化</span>
                            <span class="tag">调试</span>
                            <span class="tag">后端</span>
                        </div>
                        <p class="tutorial-excerpt">
                            深入探讨Node.js应用的性能瓶颈识别与优化策略，包括内存泄漏检测、CPU分析、异步编程优化等高级主题。包含实际案例和交互式练习。
                        </p>
                        <a href="tutorial-detail.html" class="read-more">开始学习 <i class="fas fa-arrow-right"></i></a>
                    </article>

                    <article class="tutorial-card" data-category="CSS" data-difficulty="beginner"
                        data-type="step-by-step" data-date="2023-10-05" data-views="1100" data-duration="40">
                        <h3 class="tutorial-title">
                            <a href="tutorial-detail.html">现代CSS布局：Flexbox与Grid实战指南</a>
                        </h3>
                        <div class="tutorial-meta">
                            <span><i class="far fa-calendar"></i> 2023-10-05</span>
                            <span><i class="far fa-clock"></i> 40分钟</span>
                            <span><i class="far fa-eye"></i> 1.1k浏览</span>
                            <span class="difficulty beginner"><i class="fas fa-signal"></i> 入门</span>
                            <span><i class="fas fa-book"></i> 分步教程</span>
                        </div>
                        <div class="tutorial-tags">
                            <span class="tag">CSS</span>
                            <span class="tag">布局</span>
                            <span class="tag">Flexbox</span>
                            <span class="tag">Grid</span>
                        </div>
                        <p class="tutorial-excerpt">
                            掌握现代CSS布局技术，从基础概念到实际应用。通过多个实例学习Flexbox和Grid布局，创建响应式、灵活的网页设计。
                        </p>
                        <a href="tutorial-detail.html" class="read-more">开始学习 <i class="fas fa-arrow-right"></i></a>
                    </article>

                    <article class="tutorial-card" data-category="JavaScript" data-difficulty="intermediate"
                        data-type="video" data-date="2023-09-28" data-views="780" data-duration="55">
                        <h3 class="tutorial-title">
                            <a href="tutorial-detail.html">JavaScript异步编程完全指南</a>
                        </h3>
                        <div class="tutorial-meta">
                            <span><i class="far fa-calendar"></i> 2023-09-28</span>
                            <span><i class="far fa-clock"></i> 55分钟</span>
                            <span><i class="far fa-eye"></i> 780浏览</span>
                            <span class="difficulty intermediate"><i class="fas fa-signal"></i> 中级</span>
                            <span><i class="fas fa-video"></i> 视频教程</span>
                        </div>
                        <div class="tutorial-tags">
                            <span class="tag">JavaScript</span>
                            <span class="tag">异步</span>
                            <span class="tag">Promise</span>
                            <span class="tag">Async/Await</span>
                        </div>
                        <p class="tutorial-excerpt">
                            深入理解JavaScript异步编程模型，从回调函数到Promise，再到Async/Await。通过实际案例学习如何处理复杂的异步操作。
                        </p>
                        <a href="tutorial-detail.html" class="read-more">开始学习 <i class="fas fa-arrow-right"></i></a>
                    </article>

                    <article class="tutorial-card" data-category="部署" data-difficulty="beginner"
                        data-type="step-by-step" data-date="2023-09-20" data-views="650" data-duration="35">
                        <h3 class="tutorial-title">
                            <a href="tutorial-detail.html">从零开始：将静态网站部署到GitHub Pages</a>
                        </h3>
                        <div class="tutorial-meta">
                            <span><i class="far fa-calendar"></i> 2023-09-20</span>
                            <span><i class="far fa-clock"></i> 35分钟</span>
                            <span><i class="far fa-eye"></i> 650浏览</span>
                            <span class="difficulty beginner"><i class="fas fa-signal"></i> 入门</span>
                            <span><i class="fas fa-book"></i> 分步教程</span>
                        </div>
                        <div class="tutorial-tags">
                            <span class="tag">部署</span>
                            <span class="tag">GitHub</span>
                            <span class="tag">静态网站</span>
                            <span class="tag">免费托管</span>
                        </div>
                        <p class="tutorial-excerpt">
                            学习如何使用GitHub Pages免费托管静态网站，包括自定义域名、HTTPS配置和持续集成。适合个人项目或作品集展示。
                        </p>
                        <a href="tutorial-detail.html" class="read-more">开始学习 <i class="fas fa-arrow-right"></i></a>
                    </article>
                </main>

                <aside class="sidebar">
                    <div class="sidebar-section about-me">
                        <img src="https://avatars.githubusercontent.com/u/583231?v=4" alt="Avatar" class="avatar">
                        <h3>关于作者</h3>
                        <p>全栈开发者，专注于现代Web技术。热爱开源，喜欢分享技术知识。</p>
                        <div class="social-links">
                            <a href="#"><i class="fab fa-github"></i></a>
                            <a href="#"><i class="fab fa-twitter"></i></a>
                            <a href="#"><i class="fab fa-linkedin"></i></a>
                            <a href="#"><i class="fas fa-envelope"></i></a>
                        </div>
                    </div>

                    <div class="sidebar-section">
                        <h3>教程分类</h3>
                        <div class="categories-list">
                            <a href="#" data-category="JavaScript">JavaScript</a>
                            <a href="#" data-category="React">React</a>
                            <a href="#" data-category="Vue">Vue</a>
                            <a href="#" data-category="Node.js">Node.js</a>
                            <a href="#" data-category="CSS">CSS</a>
                            <a href="#" data-category="Git">Git</a>
                            <a href="#" data-category="数据库">数据库</a>
                            <a href="#" data-category="部署">部署</a>
                        </div>
                    </div>

                    <div class="sidebar-section">
                        <h3>按难度筛选</h3>
                        <div class="tags-list">
                            <a href="#" data-difficulty="beginner">入门</a>
                            <a href="#" data-difficulty="intermediate">中级</a>
                            <a href="#" data-difficulty="advanced">高级</a>
                        </div>
                    </div>

                    <div class="sidebar-section">
                        <h3>教程类型</h3>
                        <div class="tags-list">
                            <a href="#" data-type="step-by-step">分步教程</a>
                            <a href="#" data-type="video">视频教程</a>
                            <a href="#" data-type="interactive">交互式教程</a>
                        </div>
                    </div>

                    <div class="sidebar-section">
                        <h3>订阅更新</h3>
                        <p>获取最新技术教程和学习资源</p>
                        <form style="margin-top: 12px;">
                            <input type="email" placeholder="输入您的邮箱"
                                style="width: 100%; padding: 8px; border: 1px solid var(--border-color); border-radius: 4px; background: var(--bg-color); color: var(--text-color); margin-bottom: 8px;">
                            <button type="submit"
                                style="width: 100%; padding: 8px; background: var(--accent-color); color: white; border: none; border-radius: 4px; cursor: pointer;">订阅</button>
                        </form>
                    </div>
                </aside>
            </div>

            <!-- 分页控件 -->
            <div class="pagination">
                <a href="#" class="disabled">&laquo; 上一页</a>
                <a href="#" class="current">1</a>
                <a href="#">2</a>
                <span>...</span>
                <a href="#">3</a>
                <a href="#">下一页 &raquo;</a>
            </div>
        </div>
    </div>

    <footer>
        <div class="container">
            <p>© 2023 TechBlog. 保留所有权利。</p>
            <p>采用 Github 风格设计 | 由开发者为开发者打造</p>
        </div>
    </footer>

    <script>
        // 主题切换功能
        const themeToggle = document.getElementById('themeToggle');
        const themeIcon = themeToggle.querySelector('i');
        const themeText = themeToggle.querySelector('span');

        // 检查本地存储的主题偏好
        const currentTheme = localStorage.getItem('theme') || 'light';
        if (currentTheme === 'dark') {
            document.body.classList.add('dark-theme');
            themeIcon.classList.remove('fa-moon');
            themeIcon.classList.add('fa-sun');
            themeText.textContent = '浅色模式';
        }

        themeToggle.addEventListener('click', () => {
            document.body.classList.toggle('dark-theme');
            if (document.body.classList.contains('dark-theme')) {
                localStorage.setItem('theme', 'dark');
                themeIcon.classList.remove('fa-moon');
                themeIcon.classList.add('fa-sun');
                themeText.textContent = '浅色模式';
            } else {
                localStorage.setItem('theme', 'light');
                themeIcon.classList.remove('fa-sun');
                themeIcon.classList.add('fa-moon');
                themeText.textContent = '深色模式';
            }
        });

        // 移动端菜单切换
        const mobileMenu = document.getElementById('mobileMenu');
        const navLinks = document.querySelector('.nav-links');

        mobileMenu.addEventListener('click', () => {
            navLinks.classList.toggle('active');
        });

        // 教程筛选功能
        const searchInput = document.getElementById('searchInput');
        const categoryFilter = document.getElementById('categoryFilter');
        const difficultyFilter = document.getElementById('difficultyFilter');
        const typeFilter = document.getElementById('typeFilter');
        const sortSelect = document.getElementById('sortSelect');
        const tutorialCards = document.querySelectorAll('.tutorial-card');
        const tutorialCount = document.getElementById('tutorialCount');

        function filterTutorials() {
            const searchTerm = searchInput.value.toLowerCase();
            const selectedCategory = categoryFilter.value;
            const selectedDifficulty = difficultyFilter.value;
            const selectedType = typeFilter.value;
            const sortBy = sortSelect.value;

            let visibleCount = 0;

            tutorialCards.forEach(card => {
                const title = card.querySelector('.tutorial-title a').textContent.toLowerCase();
                const excerpt = card.querySelector('.tutorial-excerpt').textContent.toLowerCase();
                const category = card.getAttribute('data-category');
                const difficulty = card.getAttribute('data-difficulty');
                const type = card.getAttribute('data-type');
                const date = card.getAttribute('data-date');
                const views = parseInt(card.getAttribute('data-views'));
                const duration = parseInt(card.getAttribute('data-duration'));

                const matchesSearch = title.includes(searchTerm) || excerpt.includes(searchTerm);
                const matchesCategory = !selectedCategory || category === selectedCategory;
                const matchesDifficulty = !selectedDifficulty || difficulty === selectedDifficulty;
                const matchesType = !selectedType || type === selectedType;

                if (matchesSearch && matchesCategory && matchesDifficulty && matchesType) {
                    card.style.display = 'block';
                    visibleCount++;
                } else {
                    card.style.display = 'none';
                }
            });

            tutorialCount.textContent = visibleCount;

            // 排序功能
            if (sortBy !== 'newest') {
                const container = document.querySelector('.tutorials-section');
                const cardsArray = Array.from(tutorialCards).filter(card => card.style.display !== 'none');

                cardsArray.sort((a, b) => {
                    switch (sortBy) {
                        case 'oldest':
                            return new Date(a.getAttribute('data-date')) - new Date(b.getAttribute('data-date'));
                        case 'popular':
                            return parseInt(b.getAttribute('data-views')) - parseInt(a.getAttribute('data-views'));
                        case 'duration':
                            return parseInt(a.getAttribute('data-duration')) - parseInt(b.getAttribute('data-duration'));
                        default:
                            return 0;
                    }
                });

                // 重新排列可见的卡片
                cardsArray.forEach(card => {
                    container.appendChild(card);
                });
            }
        }

        // 添加事件监听器
        searchInput.addEventListener('input', filterTutorials);
        categoryFilter.addEventListener('change', filterTutorials);
        difficultyFilter.addEventListener('change', filterTutorials);
        typeFilter.addEventListener('change', filterTutorials);
        sortSelect.addEventListener('change', filterTutorials);

        // 侧边栏筛选功能
        document.querySelectorAll('.categories-list a, .tags-list a').forEach(link => {
            link.addEventListener('click', (e) => {
                e.preventDefault();
                const category = link.getAttribute('data-category');
                const difficulty = link.getAttribute('data-difficulty');
                const type = link.getAttribute('data-type');

                if (category) {
                    categoryFilter.value = category;
                }
                if (difficulty) {
                    difficultyFilter.value = difficulty;
                }
                if (type) {
                    typeFilter.value = type;
                }

                filterTutorials();
            });
        });

        // 初始化显示所有教程
        filterTutorials();
    </script>
</body>

</html>